import { AppBaseEntity } from 'src/shared/database/baseEntity';
import { Column, Entity } from 'typeorm';

@Entity({
  name: 'addresses',
  comment: '地址表',
})
export class Address extends AppBaseEntity {
  @Column({
    comment: '用户id',
    name: 'user_id',
  })
  userId: number;

  @Column({
    comment: '省',
    name: 'province',
  })
  province: string;

  @Column({
    comment: '市',
    name: 'city',
  })
  city: string;

  @Column({
    comment: '区',
    name: 'district',
  })
  district: string;

  @Column({
    comment: '详细地址',
    name: 'detail',
  })
  detail: string;

  @Column({
    comment: '是否默认',
    name: 'is_default',
    default: false,
  })
  isDefault: boolean;
}
